<?php

/**
 * SSO单点登录相关计划任务
 * File Name：CronController.php
 * File Encoding：UTF-8
 * File New Time：2014-10-22 11:24:50
 * Author：水平凡
 * Mailbox：admin@abc3210.com
 */
class CronController extends YzwController {

    //同步通知
    public function actionSyn() {
        set_time_limit(600);
        header("Content-type: text/html; charset=utf-8");
        $data = RedisCluster::getInstance()->pop('sso_synchronous');
        if (empty($data) || !is_array($data)) {
            echo "没有需要同步的数据！";
            exit;
        }
        $curl = new Curl();
        $curl->post($data['url'], array('code' => $data['post']));
        echo "通知完成！";
    }

}
